using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Atom.Core;
using MTVMusicPlugin;

namespace test
{
  public partial class Form1 : Form
  {
    private MTVService service = new MTVService();
    public Form1()
    {
      InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
      // feed = new AtomFeed();
      MTVVideoResponse feed = service.VideoSearch(textBox1.Text, 0, 0);
      listBox1.Items.Clear();
      foreach (VideoEntry ae in feed.Items)
      {
        listBox1.Items.Add(ae.Entry.Author.Name+" - "+ae.Entry.Title.Content);
      }
    }

    private void button2_Click(object sender, EventArgs e)
    {
      MTVArtistResponse feed = service.ArtistSearch(textBox1.Text, 0, 0);
      listBox1.Items.Clear();
      foreach (ArtistEntry ae in feed.Items)
      {
        listBox1.Items.Add(ae.Entry.Author.Name + " - " + ae.Entry.Title.Content);
      }
    }

    private void button3_Click(object sender, EventArgs e)
    {
      MTVArtistResponse feed = service.ArtistBrowse(textBox1.Text);
      listBox1.Items.Clear();
      foreach (ArtistEntry ae in feed.Items)
      {
        listBox1.Items.Add(ae.Entry.Author.Name + " - " + ae.Entry.Title.Content);
      }
    }
  }
}